from PIL import Image

# Convert PNG to ICO
image_path = "./icon-5355895_640.png"
img = Image.open(image_path)

# Save as .ico file with multiple sizes
ico_path = "./lock_icon.ico"
img.save(ico_path, format='ICO', sizes=[(48, 48), (128, 128)])

ico_path
